package org.jground.rx.def.apps.knowledge;
import org.jground.rx.*;
import org.jground.rx.gen.*;
import org.jground.util.*;
import java.util.List;
import org.jground.rx.def.apps.accounting.*;
import org.jground.rx.def.apps.commons.*;
import org.jground.rx.def.*;
import org.jground.rx.def.apps.crm.*;
import org.jground.rx.def.apps.cip.*;
import org.jground.rx.def.apps.core.*;
import org.jground.rx.def.apps.legal.*;
import org.jground.rx.def.apps.ipm.*;
@SuppressWarnings("unused")
public class Manual extends GenRoot {

    public static final String moid = "org.jground.rx.def.apps.knowledge.Manual";

    private static final String title ="title";
    private static final String description ="description";
    private static final String context ="context";
    private static final String $CREATOR ="$CREATOR";

    public static final class AttName {
        public static final String title ="title";
        public static final String description ="description";
        public static final String context ="context";
        public static final String $CREATOR ="$CREATOR";
    }

    public static Manual createNew() { return new Manual(RXObjectService.getInstance().create(moid)); }

    public static Manual getById(String oid) { 
        IRXObject mod = RXObjectService.getInstance().getById(oid);
        if(mod == null) { return null; }
        return new Manual(mod);
    }

    public static Manual[] getByIds(String... oids) { 
        List<IRXObject> mods = RXObjectService.getInstance().getByIds(moid, oids);
        Manual[] res = new Manual[mods.size()];
        int i = 0;
        for(IRXObject mod : mods) {
            res[i] = new Manual(mod);
            i++;
        }
        return res;
    }

    public static SearchCriteria newSearchCriteria() {
        return  SearchCriteria.create(moid);
    }

    public static Manual[] search(SearchCriteria sc) {
        return  wrap(GenRoot._search(sc));
    }

    public static Manual[] wrap(List<? extends IRXObjectSynopsis> mods) { 
        Manual[] res = new Manual[mods.size()];
        int i = 0;
        for(IRXObjectSynopsis mod : mods) {
            res[i] = new Manual(mod);
            i++;
        }
        return res;
    }

    public static Manual wrap(IRXObjectSynopsis mod) { 
        return new Manual(mod);
    }

    private Manual(IRXObjectSynopsis rxObject) {this.rxObject = (IRXObject) rxObject;}

    public static String getTitleLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, title).getLabel();
    }

    public static String getTitleDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, title).getDescription();
    }

    public void setTitle(String string) {
        rxObject.set(title, _to_String(string));
    }

    public String getTitle() {
        return _to_String(rxObject.getCurrentValue(title));
    }

    public static String getDescriptionLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, description).getLabel();
    }

    public static String getDescriptionDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, description).getDescription();
    }

    public void setDescription(String text) {
        rxObject.set(description, _to_String(text));
    }

    public String getDescription() {
        return _to_String(rxObject.getCurrentValue(description));
    }

    public static String getContextLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, context).getLabel();
    }

    public static String getContextDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, context).getDescription();
    }

    public org.jground.rx.def.apps.knowledge.Context getContext() {
        return ArrayUtils.first(org.jground.rx.def.apps.knowledge.Context.wrap(rxObject.getComponents(AttName.context)));
    }

    public org.jground.rx.def.apps.knowledge.Context createContext() {
        return org.jground.rx.def.apps.knowledge.Context.wrap(rxObject.newComponent(context));
    }

    public void setContext(org.jground.rx.def.apps.knowledge.Context value) {
        rxObject.set(context, value.getOidString());
    }

    public static String get$CREATORLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getLabel();
    }

    public static String get$CREATORDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getDescription();
    }

    public void set$CREATOR(String string) {
        rxObject.set($CREATOR, _to_String(string));
    }

    public String get$CREATOR() {
        return _to_String(rxObject.getCurrentValue($CREATOR));
    }

}
